﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JigLibX.Physics;

using Microsoft.Xna.Framework;
using PloobsEngine.Physics.XJigLib;

namespace PloobsEngine.Behaviors
{
    public class ApplyImpulseAction : Controller,IAction    
    {

        private Body body;
        private Vector3 force ;

        public ApplyImpulseAction(JigLibXObject obj , Vector3 force)
        {
            body = obj.Body_;
            this.force = force;
                        
        }

        public static readonly String IMPULSE = "Impulse";
        #region IAction Members

        public override void UpdateController(float dt)
        {
            body.ApplyBodyImpulse(force);
            this.DisableController();
            
        }

        public String Action()
        {
            this.EnableController();
            return IMPULSE;
        }

        #endregion
    }
}
